package com.yc.java8.collecoper;

import java.util.Objects;

/**
 * Title:<br>
 * Description: <br>
 * Author:陈圆(chenyuan@bosssoft.com.cn) <br>
 * Date:2020/8/30
 */
public class Dish {

    private boolean vegetarian;
    private String name;

    public boolean isVegetarian() {
        return vegetarian;
    }

    public void setVegetarian(boolean vegetarian) {
        this.vegetarian = vegetarian;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public boolean equals(Object obj) {
        if (obj == null || this == null) {
            return false;
        }
        if (!(obj instanceof Dish)) {
            return false;
        }

        return this.name.equals(((Dish)obj).getName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }
}
